//
//  LBViewController.m
//  LBNestPageListView
//
//  Created by liubo on 12/04/2022.
//  Copyright (c) 2022 liubo. All rights reserved.
//

#import "LBViewController.h"
#import "LBContnerView.h"
#import <LBNestPageListView/LBNestScrollPageView.h>

@interface LBViewController ()


@property (nonatomic, strong) LBNestScrollPageView *nestView;

@property (nonatomic, strong) LBContnerView *containerView;

@property (nonatomic, strong) UIImageView *headerView;

@end

@implementation LBViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setUpUI];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)setUpUI
{
    [self.view addSubview:self.nestView];
}

#pragma mark - lazy load

- (LBNestScrollPageView *)nestView
{
    if (!_nestView) {
        LBNestScrollParam *nestScrollParam = [[LBNestScrollParam alloc] init];
        _nestView = [[LBNestScrollPageView alloc] initWithFrame:CGRectMake(0, 40, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds) - 40)  headView:self.headerView viewPageView:self.containerView nestScrollParam:nestScrollParam];
    }
    return _nestView;
}

- (UIImageView  *)headerView
{
    if (!_headerView) {
        _headerView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 200)];
        _headerView.backgroundColor = [UIColor redColor];
        _headerView.image = [UIImage imageNamed:@"截屏2022-11-27 15.16.49"];
    }
    return _headerView;
}

- (LBContnerView *)containerView
{
    if (!_containerView) {
        _containerView = [[LBContnerView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds) - 200 - 40)];
    }
    return _containerView;
}


@end
